package com.ctshk.rpc.order.tour.dto;

import com.ctshk.rpc.order.tour.code.SeriesOrderTouristQuitRefundStatusCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * <p>
 * 系列团游客信息
 * </p>
 *
 * @author 谭响
 * @since 2021-01-18
 */
@Data
@ApiModel(value = "系列团游客信息列表收款团期DTO", description = "系列团游客信息列表收款团期DTO")
public class SeriesOrderTouristInfoListCollectionTripDTO implements Serializable {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "所属订单")
    private Long orderId;

    @ApiModelProperty(value = "团期ID")
    private Long scheduleId;

    @ApiModelProperty(value = "中文姓")
    private String cnSurname;

    @ApiModelProperty(value = "中文姓名")
    private String cnName;

    @ApiModelProperty(value = "团费")
    private BigDecimal groupFee;

    @ApiModelProperty(value = "代收费用")
    private BigDecimal collectionFee;

    @ApiModelProperty(value = "调整费用")
    private BigDecimal adjustmentCost;

    @ApiModelProperty(value = "其他金额")
    private BigDecimal otherAmount;

    @ApiModelProperty(value = "付款状态（1 待付款 2 待付余款 3 已付全款 4 已退团）")
    private Integer payStatus;

    @ApiModelProperty(value = "退团状态")
    private Integer quitRefundStatus;

    @ApiModelProperty(value = "订单号")
    private String orderNumber;


    //狀態：取【收款管理】的狀態，退團狀態優先收款狀態
    public Integer getPayStatus() {
        if (Objects.equals(this.quitRefundStatus, SeriesOrderTouristQuitRefundStatusCode.ALREADY.getCode())) {
            this.payStatus = SeriesOrderTouristQuitRefundStatusCode.ALREADY.getCode();
        }
        return payStatus;
    }
}
